home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club (Business) 1997 July / Software of the Month Club - Business (Volume 239) (July 1997).iso / pc / code / a.dxr / 00004_A_Enviro Handlers TVphoneHandlers.ls next >
Encoding:
Text File  |  1996-02-15  |  13.5 KB  |  382 lines

  1. global gOBJECTSA, void, gCursorlist, sQTCharSprite, gStates, gQTmovPath, cNUllCharmovie
  2.  
  3. on EnterA08
  4.   if (getaProp(getaProp(gObjects, #Butter08Par), #State) = #NoShow) and (getaProp(getaProp(gStates, #Conditions), #Trailer) = #true) then
  5.     MakeDynamic(#Butter08Par, #State, #Show)
  6.   end if
  7.   DoRadioChannel()
  8. end
  9.  
  10. on ExitA08
  11.   if getaProp(getaProp(gObjects, #Butter08Par), #State) = #Show then
  12.     ChangeSpecialState(#Butter08Par, #Shown)
  13.   end if
  14. end
  15.  
  16. on EnterA09Phone
  17.   set OBj to getaProp(gObjects, #TVPhoneOBJ)
  18.   set movObj to getaProp(gObjects, #tvQTmovie)
  19.   if (getaProp(getaProp(gObjects, #ClockDrawer), #solved) <> #true) or (getaProp(getaProp(gObjects, #JuliaPaint), #solved) <> #true) then
  20.     if voidp(getaProp(getaProp(gStates, #BeenThere), #A09)) then
  21.       MakeDynamic(#TVPhoneOBJ, #DisplayState, #off)
  22.       MakeDynamic(#tvQTmovie, #DisplayState, #OffScreen)
  23.       Startthetimer(1, "ringPhone")
  24.     end if
  25.   else
  26.     MakeDynamic(#TVPhoneOBJ, #DisplayState, #off)
  27.     MakeDynamic(#tvQTmovie, #DisplayState, #OffScreen)
  28.   end if
  29.   if (getaProp(getaProp(gStates, #Conditions), #Trailer) = #true) and (getaProp(getaProp(gObjects, #TVPhoneOBJ), #CredPlay) = #true) then
  30.     PDARelease("J04m02c.mov")
  31.   end if
  32. end
  33.  
  34. on enterA31A
  35.   preLoadCast(the number of cast "A31crkl.aif")
  36. end
  37.  
  38. on ringPhone
  39.   playSound("A09RING.AIF", #cast, #true)
  40.   stopsound("A09RING.AIF")
  41.   MakeDynamic(#TVPhoneOBJ, #DisplayState, #ProspScram)
  42.   MakeDynamic(#tvQTmovie, #DisplayState, #ProspScram)
  43.   MakeDynamic(#TVorPhonetoggle, #DisplayState, #Phone)
  44.   set OBj to getaProp(gObjects, #TvPlayToggle)
  45.   set the castNum of sprite getaProp(OBj, #SpriteNum) to getaProp(getaProp(OBj, #cast), #play)
  46.   updateStage()
  47. end
  48.  
  49. on CleanScreenTVPhone
  50.   PauseMovieTVPhone()
  51.   ClearMessageButtons()
  52.   set OBj to getaProp(gObjects, #TVPhoneOBJ)
  53.   set movObj to getaProp(gObjects, #tvQTmovie)
  54.   MakeDynamic(#TVPhoneOBJ, #DisplayState, #off)
  55.   MakeDynamic(#tvQTmovie, #DisplayState, #OffScreen)
  56.   set the castNum of sprite getaProp(OBj, #SpriteNum) to getaProp(getaProp(OBj, #cast), #off)
  57.   set the loc of sprite getaProp(movObj, #SpriteNum) to point(-2000, -2000)
  58.   updateStage()
  59. end
  60.  
  61. on ExitA09Phone
  62.   set OBj to getaProp(gObjects, #TVPhoneOBJ)
  63.   MakeDynamic(#TvPlayToggle, #State, #pause)
  64.   MakeDynamic(#TvPlayToggle, #DisplayState, #pause)
  65.   CleanScreenTVPhone()
  66. end
  67.  
  68. on ClearMessageButtons
  69.   DelObjects([#Messrect1, #Messrect2])
  70. end
  71.  
  72. on MessagesNew mNum
  73.   set OBj to getaProp(gObjects, #TVPhoneOBJ)
  74.   set the castNum of sprite getaProp(OBj, #SpriteNum) to getaProp(getaProp(getaProp(OBj, #cast), #Message), mNum)
  75.   MakeDynamic(#TVPhoneOBJ, #MessCondition, mNum)
  76. end
  77.  
  78. on DoTvSavebutton
  79.   CleanScreenTVPhone()
  80.   if getaProp(getaProp(gObjects, #TVPhoneOBJ), #solved) = #true then
  81.     MessagesNew(#S2)
  82.     AddObjects([#Messrect1, #Messrect2])
  83.   else
  84.     MessagesNew(#S1)
  85.     AddObjects([#Messrect1])
  86.   end if
  87. end
  88.  
  89. on DoTvNewbutton
  90.   CleanScreenTVPhone()
  91.   if (getaProp(getaProp(gObjects, #ClockDrawer), #solved) = #true) and (getaProp(getaProp(gObjects, #JuliaPaint), #solved) = #true) then
  92.     if getaProp(getaProp(gObjects, #TVPhoneOBJ), #solved) = #true then
  93.       MessagesNew(#N3)
  94.     else
  95.       if getaProp(getaProp(gObjects, #TVPhoneOBJ), #solved) <> #true then
  96.         MessagesNew(#N2)
  97.         AddObjects([#Messrect1])
  98.       end if
  99.     end if
  100.   else
  101.     if (getaProp(getaProp(gObjects, #JuliaPaint), #solved) = #false) and (getaProp(getaProp(gObjects, #ClockDrawer), #solved) = #false) then
  102.       MessagesNew(#N1)
  103.       AddObjects([#Messrect1])
  104.     else
  105.       if getaProp(getaProp(gObjects, #ClockDrawer), #solved) = #true then
  106.         MessagesNew(#N4)
  107.         AddObjects([#Messrect1])
  108.       end if
  109.     end if
  110.   end if
  111. end
  112.  
  113. on PlayaMessage RectNum
  114.   set OBj to getaProp(gObjects, #TVPhoneOBJ)
  115.   set movObj to getaProp(gObjects, #tvQTmovie)
  116.   ClearMessageButtons()
  117.   if (getaProp(OBj, #MessCondition) = #S1) and (RectNum = 1) then
  118.     ReadyVideoChannel(#Agent)
  119.     setaProp(getaProp(gObjects, #TVPhoneOBJ), #CredPlay, #true)
  120.   else
  121.     if (getaProp(OBj, #MessCondition) = #S2) and (RectNum = 1) then
  122.       ReadyVideoChannel(#Agent)
  123.       setaProp(getaProp(gObjects, #TVPhoneOBJ), #CredPlay, #true)
  124.     else
  125.       if (getaProp(OBj, #MessCondition) = #S2) and (RectNum = 2) then
  126.         ReadyVideoChannel(#ProspSolve)
  127.       else
  128.         if getaProp(OBj, #MessCondition) = #N2 then
  129.           ReadyVideoChannel(#ProspSolve)
  130.           setaProp(OBj, #solved, #true)
  131.         else
  132.           if (getaProp(OBj, #MessCondition) = #N1) or (getaProp(OBj, #MessCondition) = #N4) then
  133.             ReadyVideoChannel(#ProspScram)
  134.           end if
  135.         end if
  136.       end if
  137.     end if
  138.   end if
  139.   DoTvPlayToggle(#play)
  140. end
  141.  
  142. on doDownLoadNow
  143.   set MovNAme to getaProp(getaProp(gObjects, #tvQTmovie), #DisplayState)
  144.   PauseMovieTVPhone()
  145.   set PDA to getaProp(gObjects, #PDAOBJ)
  146.   set TV to getaProp(gObjects, #TVPhoneOBJ)
  147.   if getaProp(PDA, #Aquired) = #false then
  148.     set the castNum of sprite getaProp(TV, #SpriteNum) to getaProp(getaProp(getaProp(TV, #cast), #DownLoad), #NoPDA)
  149.     playSound("A09dnlod.aif", #cast, #NOW)
  150.   else
  151.     if ((MovNAme = #TV4) or (MovNAme = #ProspSolve)) and (the Trailer of the Conditions of gStates <> #true) then
  152.       set the castNum of sprite getaProp(PDA, #SpriteNum) to getaProp(getaProp(PDA, #cast), #PDA)
  153.       set the loc of sprite getaProp(PDA, #SpriteNum) to getaProp(PDA, #PDALOC)
  154.       set the castNum of sprite getaProp(TV, #SpriteNum) to getaProp(getaProp(getaProp(TV, #cast), #DownLoad), #load)
  155.       updateStage()
  156.       playSound("A09dnlod.aif", #cast, 1)
  157.       if MovNAme = #TV4 then
  158.         PDARelease(#DocSeries)
  159.         PDARelease("J05trail.mov")
  160.       else
  161.         if MovNAme = #ProspSolve then
  162.           PDARelease(#ProsProSeries)
  163.         end if
  164.       end if
  165.       repeat while soundBusy(1)
  166.         nothing()
  167.       end repeat
  168.       set the castNum of sprite getaProp(PDA, #SpriteNum) to getaProp(getaProp(PDA, #cast), #UP)
  169.       set the loc of sprite getaProp(PDA, #SpriteNum) to getaProp(PDA, #loc)
  170.       set the castNum of sprite getaProp(TV, #SpriteNum) to getaProp(getaProp(TV, #cast), #off)
  171.       updateStage()
  172.     else
  173.       set the castNum of sprite getaProp(TV, #SpriteNum) to getaProp(getaProp(getaProp(TV, #cast), #DownLoad), #NoMes)
  174.       playSound("A09dnlod.aif", #cast, #NOW)
  175.     end if
  176.   end if
  177. end
  178.  
  179. on TurnOnPHONE
  180.   AnimateDial()
  181. end
  182.  
  183. on TurnOffPHONE
  184.   AnimateDial()
  185.   AnimateDial()
  186. end
  187.  
  188. on AnimateDial
  189.   set OBj to getaProp(gObjects, #tvRoto)
  190.   repeat with cnum in getaProp(getaProp(OBj, #cast), #Dial)
  191.     set the castNum of sprite getaProp(OBj, #SpriteNum) to cnum
  192.     CursorandUpdate()
  193.   end repeat
  194. end
  195.  
  196. on AnimateChannels type
  197.   set nChild to count(getaProp(getaProp(gObjects, #TvChanChange), #Children))
  198.   if type = #UP then
  199.     repeat with X = 1 to nChild
  200.       set onChild to getAt(getaProp(getaProp(gObjects, #TvChanChange), #Children), X)
  201.       set the castNum of sprite getaProp(getaProp(gObjects, onChild), #SpriteNum) to getaProp(getaProp(getaProp(gObjects, onChild), #cast), #on)
  202.       CursorandUpdate()
  203.       set the castNum of sprite getaProp(getaProp(gObjects, onChild), #SpriteNum) to getaProp(getaProp(getaProp(gObjects, onChild), #cast), #off)
  204.     end repeat
  205.   else
  206.     if type = #down then
  207.       repeat with X = nChild down to 1
  208.         set onChild to getAt(getaProp(getaProp(gObjects, #TvChanChange), #Children), X)
  209.         set the castNum of sprite getaProp(getaProp(gObjects, onChild), #SpriteNum) to getaProp(getaProp(getaProp(gObjects, onChild), #cast), #on)
  210.         CursorandUpdate()
  211.         set the castNum of sprite getaProp(getaProp(gObjects, onChild), #SpriteNum) to getaProp(getaProp(getaProp(gObjects, onChild), #cast), #off)
  212.       end repeat
  213.     else
  214.       if type = #random then
  215.         set templist to []
  216.         repeat with X = 1 to nChild
  217.           add(templist, X)
  218.         end repeat
  219.         repeat with X = 1 to nChild
  220.           set Y to random(count(templist))
  221.           set You to getAt(templist, Y)
  222.           deleteAt(templist, Y)
  223.           set onChild to getAt(getaProp(getaProp(gObjects, #TvChanChange), #Children), You)
  224.           set the castNum of sprite getaProp(getaProp(gObjects, onChild), #SpriteNum) to getaProp(getaProp(getaProp(gObjects, onChild), #cast), #on)
  225.           CursorandUpdate()
  226.           set the castNum of sprite getaProp(getaProp(gObjects, onChild), #SpriteNum) to getaProp(getaProp(getaProp(gObjects, onChild), #cast), #off)
  227.         end repeat
  228.       end if
  229.     end if
  230.   end if
  231. end
  232.  
  233. on TurnOnTV
  234.   set aOBJ to getaProp(gObjects, #TVPhoneOBJ)
  235.   set OBj to getaProp(gObjects, #TvChanChange)
  236.   set qtOBj to getaProp(gObjects, #tvQTmovie)
  237.   AnimateChannels(#random)
  238.   set Channelon to getaProp(getaProp(OBj, #Children), getaProp(OBj, #Channel))
  239.   set the castNum of sprite getaProp(getaProp(gObjects, Channelon), #SpriteNum) to getaProp(getaProp(getaProp(gObjects, Channelon), #cast), #on)
  240.   set ChanNum to value("#" & "TV" & getaProp(OBj, #Channel))
  241.   ReadyVideoChannel(ChanNum)
  242. end
  243.  
  244. on ReadyVideoChannel ChanNum, movieRate
  245.   set aOBJ to getaProp(gObjects, #TVPhoneOBJ)
  246.   set qtOBj to getaProp(gObjects, #tvQTmovie)
  247.   set the castNum of sprite getaProp(aOBJ, #SpriteNum) to getaProp(getaProp(aOBJ, #cast), ChanNum)
  248.   MakeDynamic(#tvQTmovie, #DisplayState, ChanNum)
  249.   set the movieTime of sprite sQTCharSprite to 0
  250.   PlayMovieTvPhone()
  251. end
  252.  
  253. on TurnOFFTV
  254.   set aOBJ to getaProp(gObjects, #TVPhoneOBJ)
  255.   set OBj to getaProp(gObjects, #TvChanChange)
  256.   AnimateChannels(#random)
  257.   MakeDynamic(#TvChanChange, #Channel, 1)
  258. end
  259.  
  260. on SwitchTVPhone
  261.   set OBj to getaProp(gObjects, #TVorPhonetoggle)
  262.   set ParObj to getaProp(gObjects, getaProp(OBj, #Parent))
  263.   if getaProp(OBj, #State) = #Phone then
  264.     CleanScreenTVPhone()
  265.     TurnOFFTV()
  266.     ChangeSpecialState(getaProp(OBj, #Parent), getaProp(OBj, #State))
  267.     TurnOnPHONE()
  268.   else
  269.     if getaProp(OBj, #State) = #TV then
  270.       CleanScreenTVPhone()
  271.       TurnOffPHONE()
  272.       ChangeSpecialState(getaProp(OBj, #Parent), getaProp(OBj, #State))
  273.       TurnOnTV()
  274.     end if
  275.   end if
  276.   MakeDynamic(#TVorPhonetoggle, #DisplayState, getaProp(OBj, #State))
  277. end
  278.  
  279. on DoTvPlayToggle Action
  280.   set qtOBj to getaProp(gObjects, #tvQTmovie)
  281.   if getaProp(qtOBj, #DisplayState) <> #OffScreen then
  282.     set OBj to getaProp(gObjects, #TvPlayToggle)
  283.     set qtOBj to getaProp(gObjects, #tvQTmovie)
  284.     updateStage()
  285.     if Action = #pause then
  286.       PauseMovieTVPhone()
  287.     else
  288.       if Action = #play then
  289.         PlayMovieTvPhone()
  290.       else
  291.         if Action = #Rew then
  292.           RewMovieTVPhone()
  293.         end if
  294.       end if
  295.     end if
  296.   end if
  297. end
  298.  
  299. on PauseMovieTVPhone
  300.   set OBj to getaProp(gObjects, #TvPlayToggle)
  301.   if getaProp(getaProp(OBj, #cast), #pause) <> the castNum of sprite getaProp(OBj, #SpriteNum) then
  302.     set qtOBj to getaProp(gObjects, #tvQTmovie)
  303.     set the castNum of sprite getaProp(OBj, #SpriteNum) to getaProp(getaProp(OBj, #cast), #pause)
  304.     updateStage()
  305.     set qtOBj to getaProp(gObjects, #tvQTmovie)
  306.     set the movieRate of sprite getaProp(qtOBj, #SpriteNum) to 0
  307.     updateStage()
  308.     playSound(getaProp(getaProp(getaProp(gObjects, #TvPlayToggle), #sound), #pause), #keyframeCast, 1)
  309.     CursorandUpdate()
  310.   end if
  311. end
  312.  
  313. on PlayMovieTvPhone
  314.   set OBj to getaProp(gObjects, #TvPlayToggle)
  315.   set qtOBj to getaProp(gObjects, #tvQTmovie)
  316.   set the castNum of sprite getaProp(OBj, #SpriteNum) to getaProp(getaProp(OBj, #cast), #play)
  317.   updateStage()
  318.   PlayMovieCharPhone()
  319. end
  320.  
  321. on PlayMovieCharPhone
  322.   set qtOBj to getaProp(gObjects, #tvQTmovie)
  323.   playSound(getaProp(getaProp(getaProp(gObjects, #TvPlayToggle), #sound), #play), #keyframeCast, 1)
  324.   set aname to getAt(getaProp(getaProp(qtOBj, #cast), getaProp(qtOBj, #DisplayState)), 1)
  325.   if the fileName of cast cNUllCharmovie <> string(gQTmovPath & aname) then
  326.     set the fileName of cast cNUllCharmovie to string(gQTmovPath & aname)
  327.   end if
  328.   updateStage()
  329.   stopsound(#ALL)
  330.   set the loc of sprite sQTCharSprite to getaProp(qtOBj, #loc)
  331.   set the movieRate of sprite sQTCharSprite to 1
  332.   updateStage()
  333. end
  334.  
  335. on RewMovieTVPhone
  336.   set qtOBj to getaProp(gObjects, #tvQTmovie)
  337.   set OBj to getaProp(gObjects, #TvPlayToggle)
  338.   set the castNum of sprite getaProp(OBj, #SpriteNum) to getaProp(getaProp(OBj, #cast), #Rew)
  339.   updateStage()
  340.   playSound(getaProp(getaProp(getaProp(gObjects, #TvPlayToggle), #sound), #Rew), #keyframeCast, #NOW)
  341.   set the movieRate of sprite sQTCharSprite to -5
  342.   repeat while soundBusy(1)
  343.     CursorandUpdate()
  344.   end repeat
  345.   set the movieRate of sprite sQTCharSprite to 0
  346.   set the movieTime of sprite sQTCharSprite to 0
  347.   CursorandUpdate()
  348.   set the castNum of sprite getaProp(OBj, #SpriteNum) to getaProp(getaProp(OBj, #cast), #pause)
  349.   MakeDynamic(#TvPlayToggle, #State, #pause)
  350.   MakeDynamic(#TvPlayToggle, #DisplayState, #pause)
  351.   CursorandUpdate()
  352. end
  353.  
  354. on DotvRoto
  355.   set OBj to getaProp(gObjects, #tvRoto)
  356.   CleanScreenTVPhone()
  357.   AnimateDial()
  358.   set ran to random(count(getaProp(getaProp(OBj, #sound), #ran)))
  359.   playSound(getAt(getaProp(getaProp(OBj, #sound), #ran), ran), #keyframeCast, #NOW)
  360. end
  361.  
  362. on DoTvChanChange
  363.   set OBj to getaProp(gObjects, #TvChanChange)
  364.   CleanScreenTVPhone()
  365.   set curChn to getaProp(OBj, #Channel)
  366.   set nextChn to curChn + 1
  367.   if nextChn > count(getaProp(OBj, #Children)) then
  368.     set nextChn to 1
  369.   end if
  370.   set curOBj to getaProp(gObjects, getAt(getaProp(OBj, #Children), curChn))
  371.   set nextOBj to getaProp(gObjects, getAt(getaProp(OBj, #Children), nextChn))
  372.   set the castNum of sprite getaProp(curOBj, #SpriteNum) to getaProp(getaProp(curOBj, #cast), #off)
  373.   set the castNum of sprite getaProp(nextOBj, #SpriteNum) to getaProp(getaProp(nextOBj, #cast), #on)
  374.   MakeDynamic(#TvChanChange, #Channel, nextChn)
  375.   ReadyVideoChannel(value("#" & "TV" & nextChn), 1)
  376. end
  377.  
  378. on GrabPDAJump
  379.   playSound("A31crkl.aif", #cast, 1)
  380.   Jumptokey(#A31B)
  381. end
  382.